﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title>绿色信贷系统</title>
	<link rel="stylesheet" type="text/css" href="css/index.css">
	<style>
		.tb>table tr:hover {
			background: #0B2A46;
		}
	</style>
</head>

<body>
	<div class="wrap">
		<div class="wid_1820">

			<div class="header">
				<p class="tmtext"><span>实时日期<span>
							<!-- 实时时间 --></span></span></p>
				<p><span class="hefont">企业信息管理系统</span></p>
				<p><span>用户名<a href="login.html">[退出]</a></span></p>
			</div>
			<h3 class="title">申请绿色信用贷款企业名单</h3>
			<div class="content"> <img class="guang" src="img/title.png" />
				<div class="tb tb_left">
					<h3>A</h3>
					<table>
						<thead>
							<tr class="tb_title">
								<td>企业名称</td>
								<td>盈利对利息覆盖能力</td>
								<td>流动性还本付能力</td>
								<td>清偿性还本付息能力</td>
								<td>企业绿色评分</td>
								<td>审核状态</td>
							</tr>
						</thead>
						<tbody id="table1">
							<tr class="tb_title_dom">
								<td>A公司</td>
								<td>0.9</td>
								<td>0.29</td>
								<td>0.08</td>
								<td>95</td>
								<td onclick="this.innerHTML='已通过'">待审核</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="tb tb_right">
					<h3>B</h3>
					<table>
						<thead>
							<tr class="tb_title">
								<td>企业名称</td>
								<td>盈利对利息覆盖能力</td>
								<td>流动性还本付能力</td>
								<td>清偿性还本付息能力</td>
								<td>企业绿色评分</td>
								<td>审核状态</td>
							</tr>
						</thead>
						<tbody id="table2">
							<tr class="tb_title_dom">
								<td>B公司</td>
								<td>0.8</td>
								<td>0.23</td>
								<td>0.05</td>
								<td>90</td>
								<td>
									<div class="col-sm-3">
										<a class="btn btn-sm blue">待审核</a>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div style="clear:both"></div>
				<div class="tb tb_left">
					<h3>C</h3>
					<table>
						<thead>
							<tr class="tb_title">
								<td>企业名称</td>
								<td>盈利对利息覆盖能力</td>
								<td>流动性还本付能力</td>
								<td>清偿性还本付息能力</td>
								<td>企业绿色评分</td>
								<td>审核状态</td>
							</tr>
						</thead>
						<tbody id="table3">
							<tr class="tb_title_dom">
								<td>C公司</td>
								<td>0.8</td>
								<td>0.2</td>
								<td>0.04</td>
								<td>85</td>
								<td>未通过</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="tb tb_right">
					<h3>D</h3>
					<table>
						<thead>
							<tr class="tb_title">
								<td>企业名称</td>
								<td>盈利对利息覆盖能力</td>
								<td>流动性还本付能力</td>
								<td>清偿性还本付息能力</td>
								<td>企业绿色评分</td>
								<td>审核状态</td>
							</tr>
						</thead>
						<tbody id="table4">
							<tr class="tb_title_dom">
								<td>D公司</td>
								<td>0.7</td>
								<td>0.18</td>
								<td>0.05</td>
								<td>80</td>
								<td>未通过</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</body>

</html>
<script src="libs/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8">
	< /scrip> <
	script src = "js/index.js"
	type = "text/javascript"
	charset = "utf-8" >
</script>
<script>
	// for循环实现动态添加公司并查看（待开发）

	$.ajax({
		url: "/test/enterprise/findall.do", //后台请求的数据
		dataType: "json", //数据格式
		type: "post", //请求方式
		async: true, //是否异步请求
		success: function (data) { //如果请求成功，返回数据。
			console.log(data);
			//var obj=eval(data);
			var mes = JSON.stringify(data);
			console.log(mes);
			console.log(data.length)
			var html = "";
			for (var i = 0; i < data.length; i++) {
				//console.log(data[i]);
				//console.log(i);
				//console.log(data[i].name);
				var name = data[i].name;
				var profit = data[i].profit;
				var mobility = data[i].mobility;
				var payOff = data[i].payOff;
				var greenRating = data[i].greenRating;
				console.log(name);
				console.log(profit);
				console.log(mobility);
				console.log(payOff);
				console.log(greenRating);
				html += "<tr class='tb_title_dom'><td>" + name + "</td><td>" + profit + "</td><td>" +
					mobility + "</td><td>" + payOff + "</td><td>" + greenRating + "</td></tr>";
			}
			$("#table1").html(html); //在html页面class=table1的标签里显示html内容
		},
	})
	$("tbody").delegate(".tb_title_dom", "click", function () {
		if ($(this).find("td").eq(0).html() == "A公司") {
			window.location.href = "CompanyA.html";
		}
		if ($(this).find("td").eq(0).html() == "B公司") {
			window.location.href = "CompanyB.html";
		}
		if ($(this).find("td").eq(0).html() == "C公司") {
			window.location.href = "CompanyC.html";
		}
		if ($(this).find("td").eq(0).html() == "D公司") {
			window.location.href = "CompanyD.html";
		}
	});
</script>